﻿@model Bricks.Site.Models.BaklogTaskView
@{
    ViewBag.Title = "BaklogTaskList";
    Layout = "~/Views/Shared/_UserPage.cshtml";
}

<script type="text/javascript">
    $(function () {
        //当页面首次刷新的时候执行的事件
        initTable();
    });

    function initTable() {
        $('#myDataGrid').datagrid({
            url: '/BaklogTask/GetBaklogTaskList',
            iconCls: 'icon-bricks',
            nowrap: true,
            autoRowHeight: false,
            striped: true,
            collapsible: true,
            pagination: true,
            pageSize: 20,
            rownumbers: true,
            remoteSort: false,
            idField: 'ID',
            singleSelect: true,
            columns: [[
                        { title: 'ProcessType', field: 'ProcessType', hidden: true },
                        { title: 'ID', field: 'ID', hidden: true },
                        { title: 'AssociatedFlowCode', field: 'AssociatedFlowCode', hidden: true },
                        { title: 'AssociatedFlowNodeCode', field: 'AssociatedFlowNodeCode', hidden: true },
                        { title: 'AssociatedProcessUserDepartment', field: 'AssociatedProcessUserDepartment', hidden: true },
                        { title: 'AssociatedProcessUser', field: 'AssociatedProcessUser', hidden: true },
                        { title: 'RecordID', field: 'RecordID', hidden: true },
                        {
                            title: '描述', field: 'DisplayText', width: 1000,
                            formatter:
                            function (value, row, index) {
                                return '<a href="#" onclick=PopBaklogTaskRequest("' + row.AssociatedFlowCode + '","' + row.ProcessType + '","' + row.ID + '","' + row.AssociatedFlowNodeCode + '","' + row.AssociatedProcessUserDepartment + '","' + row.AssociatedProcessUser + '","' + row.RecordID + '")>' + row.DisplayText + '</a>';
                            }
                        },
                        { title: '时间', field: 'AssociatedDate', width: 250, sortable: true },
            ]]
        });
    }

    function PopRequest(flowCode, processType, sourceID, flowNodeCode, processUserDepartment, processUser, id) {
        if (flowCode == "AlterOne" || flowCode == "AlterTwo" || flowCode == "AlterThree") {
            showMyWindow("#myWindow", "", "/Alter/Alter?MenuCode=Alter&sourceType=2&processType=" + processType + "&sourceID=" + sourceID + "&associatedNodeCode=" + flowNodeCode + "&lastUpdateUserDepartment=" + processUserDepartment + "&lastUpdateUser=" + processUser + "&alterID=" + id, 1000, 500, true, true, true);
        }
        else if (flowCode == "AlterOrderOne") {
            showMyWindow("#myWindow", "", "/AlterOrder/AlterOrder?MenuCode=AlterOrder&sourceType=2&processType=" + processType + "&sourceID=" + sourceID + "&associatedNodeCode=" + flowNodeCode + "&lastUpdateUserDepartment=" + processUserDepartment + "&lastUpdateUser=" + processUser + "&alterOrderID=" + id, 1000, 500, true, true, true);
        }
        else if (flowCode == "Expense") {
            showMyWindow("#myWindow", "", "/Expense/Expense?MenuCode=Expense&sourceType=2&processType=" + processType + "&sourceID=" + sourceID + "&associatedNodeCode=" + flowNodeCode + "&lastUpdateUserDepartment=" + processUserDepartment + "&lastUpdateUser=" + processUser + "&expenseID=" + id, 1000, 500, true, true, true);
        }
        else if (flowCode == "TotalMaintenance") {
            showMyWindow("#myWindow", "", "/TotalMaintenance/TotalMaintenance?MenuCode=TotalMaintenance&sourceType=2&processType=" + processType + "&sourceID=" + sourceID + "&associatedNodeCode=" + flowNodeCode + "&lastUpdateUserDepartment=" + processUserDepartment + "&lastUpdateUser=" + processUser + "&totalMaintenanceID=" + id, 1000, 500, true, true, true);
        }
        else if (flowCode == "YearPlan") {
            showMyWindow("#myWindow", "", "/YearPlan/YearPlan?MenuCode=YearPlan&sourceType=2&processType=" + processType + "&sourceID=" + sourceID + "&associatedNodeCode=" + flowNodeCode + "&lastUpdateUserDepartment=" + processUserDepartment + "&lastUpdateUser=" + processUser + "&yearPlanID=" + id, 1000, 500, true, true, true);
        }
        else if (flowCode == "MonthPlan") {
            showMyWindow("#myWindow", "", "/MonthPlan/MonthPlan?MenuCode=MonthPlan&sourceType=2&processType=" + processType + "&sourceID=" + sourceID + "&associatedNodeCode=" + flowNodeCode + "&lastUpdateUserDepartment=" + processUserDepartment + "&lastUpdateUser=" + processUser + "&monthPlanID=" + id, 1000, 500, true, true, true);
        }
        else if (flowCode == "SectionSalary") {
            showMyWindow("#myWindow", "", "/SectionSalary/SectionSalary?MenuCode=SectionSalary&sourceType=2&processType=" + processType + "&sourceID=" + sourceID + "&associatedNodeCode=" + flowNodeCode + "&lastUpdateUserDepartment=" + processUserDepartment + "&lastUpdateUser=" + processUser + "&sectionSalaryID=" + id, 1000, 500, true, true, true);
        }
    }

    function cancelPopWindow()
    {
        colseMyWindow("#myWindow");
    }
</script>

<div class="easyui-panel" fit = "true">
    <table id="myDataGrid" fit="true"></table>
</div>
